<?php
use_helper("users");
$comments = @$pages->getResults();
if(@$pages->getNbResults()>0){
$shownum="<div class='page_num'><b>";
if(1==@$pages->getPage())
    $shownum.=1;
else if(@$pages->getPage()>=@$pages->getLastPage())
{
    if((@$pages->getNbResults()-$recordCount)<-2)
        $shownum.=1;
    else
        $shownum.=@$pages->getNbResults()-$recordCount+1;
}
else
    $shownum.=(@$pages->getPreviousPage()*$recordCount)+1;

$shownum.="-";
if(@$pages->getPage()>=@$pages->getLastPage())
    $shownum.=@$pages->getNbResults();
else
    $shownum.=$recordCount*@$pages->getPage();
echo $shownum.="</b> of <b>".@$pages->getNbResults()."</b></div>";
foreach($comments as $comment)
{
    echo "<div class='pl_con'>
               <div class='pl_con_l'><img src='".fileExist($comment->getUsers()->getAvatar())."'  /></div>
            <div class='pl_con_r'>
             <div class='pl_username'><span>".$comment->getUsers()->getNickname()."</span>
             <span class='pl_date'>评论时间：".@utility::DateDiff(date("Y-m-d H:i:s"),$comment->getCreateTime())."</span>
            </div>
             <div class='pl_contant'>".$comment->getBody()."</div>
           </div>
         </div>";
            }
echo $shownum."<div class='page_num'>";
if(@$pages->getPage()>1)
    echo "<a href='javascript:trunP(".@$pages->getPreviousPage().")'> < Prev</a>";
if(@$pages->getPage()>1&&@$pages->getPage()<@$pages->getLastPage())
    echo " | ";
if(@$pages->getPage()<@$pages->getLastPage())
    echo "<a href='javascript:trunP(".@$pages->getNextPage().")' >Next ></a>";
echo "</div>";
}
?>